package com.yunji.framework_template.orm.persistence.mapper;

import java.util.List;
import java.util.Map;

import com.yunji.framework_template.common.web.Page;
import com.yunji.framework_template.orm.persistence.model.News;

public interface NewsMapper {

    int deleteByPrimaryKey(Map param);

    int insert(News record);

    int insertSelective(News record);

    News selectByPrimaryKey(Map param);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKey(News record);

    /**
     * 查看次数+1
     * 
     * @param record
     * @return
     */
    int addViewsByPrimaryKey(News record);

    /**
     * Like次数+1
     * 
     * @param record
     * @return
     */
    int addLikesByPrimaryKey(News record);

    /**
     * Dislike次数+1
     * 
     * @param record
     * @return
     */
    int addDislikesByPrimaryKey(News record);

    /**
     * 评论次数+1
     * 
     * @param record
     * @return
     */
    int addCommentsByPrimaryKey(News record);

    List<News> selectByCondition(News record);

    List<News> selectAll();

    List<News> selectByPage(Page page);

    Long count(News record);

    int deleteByCondition(News record);
}
